﻿using DoNet.Core.Models;
using SqlSugar;
using System.ComponentModel;

namespace DoNet.Bpmn.Models
{
    /// <summary>
    /// Represents the configuration for loop in BPMN node.
    /// </summary>
    [SugarTable("Bpmn_NodeLoopConfig", "")]
    [Serializable]
    public class BpmnNodeLoopConfig : TenantEntity, ICreationAudited, IModificationAudited, IDeleteAudited
    {
        /*
        `id` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT 'auto incr id',
        `bpmn_node_id` BIGINT(20) NULL COMMENT 'node id',
        `loop_end_type` INT(11) NULL COMMENT 'loop type 1 for organizational line; 2 for reporting line',
        `loop_number_plies` INT(11) NULL COMMENT 'how many levels',
        `loop_end_person` VARCHAR(50) NULL COMMENT 'end user',
        `noparticipating_staff_ids` VARCHAR(255) NULL COMMENT 'end staff ids',
        `loop_end_grade` INT(11) NULL COMMENT 'end level',
        `remark` VARCHAR(255) NULL COMMENT 'remark',
        `is_del` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '0:not deleted,1:deleted',
        `create_user` VARCHAR(50) NULL COMMENT 'create user',
        `create_time` timestamp DEFAULT CURRENT_TIMESTAMP COMMENT 'create time',
        `update_user` VARCHAR(50) NULL COMMENT 'update user',
        `update_time` timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'update time', 
        */
        /// <summary>
        /// 获取或设置 编号
        /// </summary>
        [DisplayName("编号")]
        [SugarColumn(IsPrimaryKey = true, ColumnDescription = "编号,主键")]
        public override long Id { get; set; }

        /// <summary>
        /// Node ID.
        /// </summary>
        [SugarColumn(ColumnDescription = "")]
        public virtual long BpmnNodeId { get; set; }

        /// <summary>
        /// Loop end type (used for extensibility, can be ignored if not needed).
        /// </summary>
        public int? LoopEndType { get; set; }

        /// <summary>
        /// Number of loop levels.
        /// </summary>
        public int? LoopNumberPlies { get; set; }

        /// <summary>
        /// End person.
        /// </summary>
        public string LoopEndPerson { get; set; } = string.Empty;

        /// <summary>
        /// Staff IDs not participating in the loop.
        /// </summary>
        public string NoparticipatingStaffIds { get; set; } = string.Empty;

        /// <summary>
        /// End grade.
        /// </summary>
        public int? LoopEndGrade { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [SugarColumn(ColumnDescription = "备注")]
        public virtual string Description { get; set; } = string.Empty;

        /// <summary>
        /// 创建日期
        /// </summary>
        [SugarColumn(ColumnDescription = "创建日期")]
        public virtual DateTime? CreatorTime { get; set; }

        /// <summary>
        /// 创建用户主键
        /// </summary>
        [SugarColumn(ColumnDescription = "创建用户主键")]
        public virtual long? CreatorUserId { get; set; }

        /// <summary>
        /// 最后修改时间
        /// </summary>
        [SugarColumn(ColumnDescription = "最后修改时间")]
        public virtual DateTime? LastModifyTime { get; set; }

        /// <summary>
        /// 最后修改用户
        /// </summary>
        [SugarColumn(ColumnDescription = "最后修改用户")]
        public virtual long? LastModifyUserId { get; set; }

        /// <summary>
        /// 删除标志
        /// </summary>
        [SugarColumn(ColumnDescription = "删除标志")]
        public virtual bool DeleteMark { get; set; }

        /// <summary>
        /// 删除时间
        /// </summary>
        [SugarColumn(ColumnDescription = "删除时间")]
        public virtual DateTime? DeleteTime { get; set; }

        /// <summary>
        /// 删除用户
        /// </summary>
        [SugarColumn(ColumnDescription = "删除用户")]
        public virtual long? DeleteUserId { get; set; }
    }
}
